import { createRouter, createWebHistory } from 'vue-router'
import Home from  '@/views/Home/index.vue'
import Liebiao from '@/views/Liebiao/index.vue'
import ShoppingCart from '@/views/ShoppingCart/index.vue'
import Self from '@/views/Self/index.vue'
import ly404 from '@/views/404/index.vue'
import SearchHot from '@/views/search/components/SearchHot.vue'


// import HomeView from '../views/HomeView.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'/home'
     
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/login',
      name: 'login',
      component:()=>import("@/views/Login/index.vue")   
    },
    {
      path: '/registration',
      name: 'registration',
      component:()=>import('@/views/Registration/index.vue')
    },
    {
      path: '/liebiao',
      name: 'liebiao',
      component: Liebiao
    }, 
     {
      path: '/self',
      name: 'self',
      component: Self
    }, 
    {
      path: '/shoppingcart',
      name: 'shoppingcart',
      component:ShoppingCart,  
     
    },{
      path: '/search',
      name: 'search',
      component:()=>import('@/views/search/index.vue'),
      meta:{ isShowFooter:true}  
    },
    {
      path: '/goodslist',
      name: 'goodslist',
      component:()=>import('@/views/Goodslist/index.vue'),  
      meta:{ isShowFooter:true}  

    },
    {
      path: '/xiangqing',
      name: 'xiangqing',
      component:()=>import('@/views/XiangQing/index.vue'),  
      meta:{ isShowFooter:true}  
    },
    {
      path: '/order',
      name: 'order',
      component:()=>import('@/views/Order/index.vue'),  
      meta:{ isShowFooter:true}  
    },
    {
      //404路由
      path:'/ly404',
      name:'ly404',
      component:ly404,
      meta:{ isShowFooter:true}   //单独给404页面不显示底部
    },
    {
      // 匹配任意内容
      path: '/:pathMatch(.*)*',
      redirect: '/ly404'
    }
  ]
})

export default router
